package com.huawei.appmarket.service.store.awk.node;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.view.ViewGroup.LayoutParams;
import android.widget.LinearLayout;
import com.huawei.appgallery.foundation.ui.framework.widget.Space;
import com.huawei.appmarket.framework.widget.ExpandableLayout;
import com.huawei.appmarket.framework.widget.ExpandableLayout.e;
import com.huawei.appmarket.service.store.awk.card.NormalCard;
import java.util.ArrayList;
import o.cdr;
import o.eib;
import o.ewm.h;
import o.ewm.j;

public class NormalNode extends cdr {
    private NormalCard ˊ;
    private d ॱॱ = new d();
    private boolean ᐝ = true;

    class d implements e {
        final /* synthetic */ NormalNode ॱ;

        private d(NormalNode normalNode) {
            this.ॱ = normalNode;
        }

        public void ˋ() {
            for (int i = 0; i < this.ॱ.ˏ(); i++) {
                if (((NormalCard) this.ॱ.ˎ(i)).ʻ() != null && this.ॱ.ᐝ) {
                    ((NormalCard) this.ॱ.ˎ(i)).ˏ(((NormalCard) this.ॱ.ˎ(i)).ʻ());
                }
            }
            this.ॱ.ᐝ = false;
        }
    }

    public NormalNode(Context context) {
        super(context, eib.ॱˎ());
    }

    public int ˏ() {
        return eib.ॱˎ();
    }

    public ArrayList<String> z_() {
        if (this.ˊ == null || this.ˊ.ॱॱ() == null || !this.ˊ.ॱˊ()) {
            return null;
        }
        return this.ˊ.ॱॱ().z_();
    }

    public ViewGroup ˊ(LayoutInflater layoutInflater, ViewGroup viewGroup) {
        return (ViewGroup) layoutInflater.inflate(h.ˎͺ, viewGroup);
    }

    public boolean ˊ(ViewGroup viewGroup, ViewGroup viewGroup2) {
        viewGroup.setPadding(0, viewGroup.getPaddingTop(), 0, viewGroup.getPaddingBottom());
        LayoutParams layoutParams = new LinearLayout.LayoutParams(-1, -1);
        layoutParams.weight = 1.0f;
        int ˏ = ˏ();
        LayoutInflater from = LayoutInflater.from(this.ॱ);
        LinearLayout linearLayout = (LinearLayout) viewGroup.findViewById(j.ˏˏ);
        LayoutParams layoutParams2 = new LinearLayout.LayoutParams(eib.ᐝॱ(), -1);
        View inflate = from.inflate(h.ˊʽ, null);
        ExpandableLayout expandableLayout = (ExpandableLayout) inflate.findViewById(j.ꓸˏ);
        for (int i = 0; i < ˏ; i++) {
            if (i != 0) {
                linearLayout.addView(new Space(this.ॱ), layoutParams2);
            }
            View inflate2 = from.inflate(h.ʽᐝ, null);
            this.ˊ = ˎ(inflate2);
            if (i != 0) {
                this.ˊ.ˏ(false);
            }
            this.ˊ.ˏ(expandableLayout);
            ˊ(this.ˊ);
            linearLayout.addView(inflate2, layoutParams);
        }
        expandableLayout.setOnExpandStatusChangeListener(this.ॱॱ);
        viewGroup.addView(inflate);
        return true;
    }

    public void ˏ(int i) {
        for (int i2 = 0; i2 < ˏ(); i2++) {
            ˎ(i2).ᐝ((ˏ() * i) + i2);
        }
    }

    protected NormalCard ˎ(View view) {
        NormalCard normalCard = new NormalCard(this.ॱ);
        normalCard.ˏ(view);
        return normalCard;
    }

    public cdr ॱॱ() {
        return this.ˊ.ॱॱ();
    }

    public boolean ʻ() {
        return true;
    }
}
